package com.servlet;

import com.entity.Students;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/UpdateServlet")
public class UpdateServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //详见InsertServlet
        request.setCharacterEncoding("utf-8");
        Students stu = new Students();
        stu.setSid(Integer.parseInt(request.getParameter("Sid")));
        stu.setSname(request.getParameter("Sname"));
        stu.setSage(request.getParameter("Sage"));
        stu.setSclass(request.getParameter("Sclass"));
        Update update = new Update();
        update.update(stu);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
